668b52
@@ -139,6 +139,17 @@
public void load(InputStream is) throws HiveException {
     }
   }
 
+  @Override
+  public void copyToNewInstance(Object newInstance) throws UDFArgumentException {
+    super.copyToNewInstance(newInstance); // Asserts the class invariant. (Same types.)
+    GenericUDFInFile that = (GenericUDFInFile)newInstance;
+    if (that != this) {
+      that.set = (this.set == null ? null : (HashSet<String>)this.set.clone());
+      that.strObjectInspector = this.strObjectInspector;
+      that.fileObjectInspector = this.fileObjectInspector;
+    }
+  }
+
   @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
